package com.echo.tagparse;

import edu.smu.tspell.wordnet.Synset;
import edu.smu.tspell.wordnet.SynsetType;
import edu.smu.tspell.wordnet.WordNetDatabase;

public class WordClass {
	public WordClass(){
		System.setProperty("wordnet.database.dir", "D:\\Word Net\\dict\\");
	}
	
	public void findAdj(String test){
		String fly = "riding";
		WordNetDatabase database = WordNetDatabase.getFileInstance();
		Synset[] nounFlies = database.getSynsets(fly, SynsetType.NOUN);
		if (nounFlies.length > 0)
		{
			System.out.println("The following synsets contain '" +
					 fly+ "' or a possible base form " +
					"of that text:");
			for (int i = 0; i < nounFlies.length; i++)
			{
				System.out.println("");
				String[] wordForms = nounFlies[i].getWordForms();
				for (int j = 0; j < wordForms.length; j++)
				{
					System.out.print((j > 0 ? ", " : "") +
							wordForms[j]);
				}
				System.out.println(": " + nounFlies[i].getDefinition());
			}
		}
		else
		{
			System.err.println("No synsets exist that contain " +
					"the word form '" + fly + "'");
		}
	}
	
	public static void main(String[] args){
		WordClass ww = new WordClass();
		String test = "Some people say the story is too swallow and lacking but I found that it told the story " +
				"behind the original halo story. The price for the game is not to high because it does come with all the halo " +
				"3 multilayer maps and its own campaign and firefight mode, which is tons of fun.";
		ww.findAdj(test);
	}
}
